package com.lwl.blog.service.impl;

import com.lwl.blog.core.dao.IBaseDao;
import com.lwl.blog.core.service.BaseServiceImpl;
import com.lwl.blog.dao.InvitataionDao;
import com.lwl.blog.dao.impl.InvitataionDaoImpl;
import com.lwl.blog.entity.InvitataionEntity;
import com.lwl.blog.service.InvitationService;
import com.lwl.blog.vo.IndexDataVo;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public class InvitationServiceImpl extends BaseServiceImpl<InvitataionEntity> implements InvitationService {
    private InvitataionDao invitataionDao=new InvitataionDaoImpl();

    @Override
    protected IBaseDao<InvitataionEntity> getBaseDao() {
        return invitataionDao;
    }

    @Override
    public List<IndexDataVo> indexDateList() throws SQLException {
        return invitataionDao.indexDateList();
    }

    @Override
    public boolean save(InvitataionEntity invitataionEntity) throws Exception {
        invitataionEntity.setStatus(1);
        invitataionEntity.setType(1);
        invitataionEntity.setCreateTime(new Date());
        invitataionEntity.setScore(0.1);
        invitataionEntity.setCommentCount(0);


        return super.save(invitataionEntity);
    }
}
